<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/commit/head.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div class="layui-body">
    <div style="padding: 15px;">
    	<i class="layui-icon">&#xe66f;</i>修改资料
		<hr class="layui-bg-green">
    	<form class="layui-form" action="user/updateById.html" method="post" enctype="multipart/form-data">
    			<input type="hidden" name="id" value="${updateAuUser.id}">
			 <div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">用户角色：</label>
			      <div class="layui-input-inline">
			        <select name="roleid">
			          	<option value="" >请选择</option>
						<option value="1" ${updateAuUser.roleid==1 ?"selected":""}>会员</option>
						<option value="2" ${updateAuUser.roleid==2?"selected":""}>管理员</option>
						<option value="11" ${updateAuUser.roleid==11 ?"selected":""}>其他</option>
			        </select>
			      </div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">会员类型：</label>
			      <div class="layui-input-inline">
			        <select name="usertype" lay-search="" lay-verify="required">
			          	<option value="">请选择</option>
						<option value="0" ${updateAuUser.usertype==0 ?"selected":""}>注册会员</option>
						<option value="1" ${updateAuUser.usertype==1 ?"selected":""}>消费会员</option>
						<option value="2" ${updateAuUser.usertype==2 ?"selected":""}>vip会员</option>
						<option value="3" ${updateAuUser.usertype==3 ?"selected":""}>加盟店</option>
			        </select>
			      </div>
			    </div>
			  </div>
			  
			<div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">用户名：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.logincode }" id="code" name="logincode" class="layui-input" readonly="readonly" type="tel" autocomplete="off" lay-verify="required|phone">
			      </div>
			      <div id="namecheck"></div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">姓名：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.username }" name="username" class="layui-input" type="text" autocomplete="off" lay-verify="email">
			      </div>
			    </div>
			</div>
			
			<div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">证件类型：</label>
			      <div class="layui-input-inline">
			        <select name="cardtype">
			          	<option value="">请选择</option>
						<option value="0" ${updateAuUser.cardtype==0 ?"selected":""}>二代身份证</option>
						<option value="1" ${updateAuUser.cardtype==1 ?"selected":""}>护照</option>
						<option value="2" ${updateAuUser.cardtype==2 ?"selected":""}>军官证</option>
			        </select>
			      </div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">证件号码：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.idcard}" name=idcard class="layui-input" type="text" autocomplete="off" lay-verify="email">
			      </div>
			    </div>
			</div>
			
			<div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">收获国家：</label>
			      <div class="layui-input-inline">
			        <select name="country">
			          	<option value="" >请选择</option>
						<option value="0" ${updateAuUser.country==0?"selected":""}>中国</option>
						<option value="1" ${updateAuUser.country==1?"selected":""}>美国</option>
			        </select>
			      </div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">移动电话：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.mobile }" name="mobile" class="layui-input" type="text" autocomplete="off" lay-verify="email">
			      </div>
			    </div>
			</div>
			
			<div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">电子邮件：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.email }" name="email" class="layui-input" type="tel" autocomplete="off" lay-verify="required|phone">
			      </div>
			    </div>

			<div class="layui-form-item">
			    <div class="layui-inline">
			      <label class="layui-form-label">开户行：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.postcode }" name="postcode" class="layui-input" type="tel" autocomplete="off" lay-verify="required|phone">
			      </div>
			    </div>
			    <div class="layui-inline">
			      <label class="layui-form-label">开户卡号：</label>
			      <div class="layui-input-inline">
			        <input value="${updateAuUser.bankaccount }" name="bankaccount" class="layui-input" type="text" autocomplete="off" lay-verify="email">
			      </div>
			    </div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">开户人：</label>
				<div class="layui-input-block">
					<input value="${updateAuUser.accountholder }" type="text" name="accountholder"  autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">上传身份证图片（正反面）：</label>
				<div class="layui-input-block">
					<input type="file" name="partFile1"  autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">上传银行卡图片：</label>
				<div class="layui-input-block">
					<input type="file" name="partFile2"  autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-btn-group" style="padding-left: 1000px;">
<!-- 				<button class="layui-btn layui-btn-radius">保存</button>
 -->				<input id="save" type="submit" class="layui-btn layui-btn-radius" value="保存" >
					<input id="close" type="button" class="layui-btn layui-btn-radius" value="关闭" >
			</div>
			
			<input id="path" type="hidden" value="${updateAuUser.idcardpicpath}"> 
			<a href="user/download.html?path=${updateAuUser.idcardpicpath}" target="_blank">下载</a>
 			<input type="button" id="down" value="下载"> 
		</form>
    </div>
  </div>  

<script type="text/javascript">
	$("#close").click(function(){
		window.location.href="user/userlist.html"
		
	})
	
	$("#down").click(function(){
		var p=$("#path").val();
		console.log(p)
		$.post("user/download.html","path="+$("#path").val(),function(){
			
		})
		
	})
</script>
<%@include file="/WEB-INF/commit/dibu.jsp"%>